package com.qunar.wan.common_api.service;

import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.Query;

import java.io.IOException;
import java.util.concurrent.Future;

/**
 * Created by hiCyoung on 13-12-17.
 * 使用Lucene实现搜索
 */
public interface LuceneSearchService<T> extends SearchService {

    /**
     * 添加Lucene文件索引
     *
     * @param t
     * @return
     */
    Future<Boolean> addIndexDoc(T t) throws IOException;

    /**
     * 构建查询Query
     *
     * @param queryString
     * @return
     * @throws org.apache.lucene.queryparser.classic.ParseException
     */
    Query buildQuery(String queryString) throws ParseException;


    /***
     *重建索引
     */
     void reIndexAll() throws IOException;

}
